#!/usr/bin/expect

set timeout 60
#set password [lindex $argv 0]
spawn mysql_secure_installation
expect {
"enter for none" { send "\n"; exp_continue}
"Y/n" { send "Y\n" ; exp_continue}
"password" { send "123456\n"; exp_continue}
"New password" { send "123456\n"; exp_continue}
"Re-enter new password" { send "123456\n"; exp_continue}
"Cleaning up" { send "\n"}
}
